{layout name="public/layout" /}
        {include file='yxnavbar'}
{if $_G['isSuperAdmin']}
<div class="main">
    <ul class="nav nav-tabs">
        <li {if $op =='display'}class="active"{/if}><a href="{php echo createWebUrl('bill', array('themeid'=>$themeid,'op'=>'display'));}">资金记录</a></li>
        <li {if $op =='topup'}class="active"{/if}><a href="{php echo createWebUrl('bill', array('themeid'=>$themeid,'op'=>'topup'));}">充值</a></li>
        {if ($_G['username']!=='caiwu' && $_G['username']!=='caiwu') }
        <li {if $op =='withdraw'}class="active"{/if}><a href="{php echo createWebUrl('bill', array('themeid'=>$themeid,'op'=>'withdraw'));}">提现</a></li>
        {/if}
        {if $op =='view'}
        <li class="active" ><a href="#">查看详情</a></li>
        {elseif $op =='shenhe'}
        <li class="active" ><a href="#">帐单审核</a></li>
        {/if}
    </ul>
</div>
{elseif $op =='view'}
<div class="main">
    <ul class="nav nav-tabs">
        <li {if $op =='display'}class="active"{/if}><a href="{php echo createWebUrl('bill', array('themeid'=>$themeid,'op'=>'display'));}">资金记录</a></li>
        {if $op =='view'}
        <li class="active" ><a href="#">查看详情</a></li>
        {/if}
    </ul>
</div>
{/if} 
<style>
.table td span{display:inline-block;margin-top:4px;}
.table td input{margin-bottom:0;}
</style>
{if $op == 'edit'} 
<div class="clearfix">
<form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" onsubmit="return checkwithdraw()">
    <div class="panel panel-default">
        <div class="panel-heading">提现</div>
        <div class="panel-body">
                {if $_G['isSuperAdmin'] && $_G['username']!=='caiwu' && $_G['username']!=='chuna' }
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>当前帐单</label>
                        <div class="col-sm-8 col-xs-12">
                            <textarea class="form-control" name="bill" rows="10">{$bill['bill']}</textarea>
                        </div>
                    </div>
                    {if empty($result['wechat1']) && empty($result['wechat2']) && empty($result['openid']) && empty($result['bankid'])}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>商家帐户</label>
                        <div class="col-sm-8 col-xs-12">
                            <input type="text" class="form-control" placeholder="" name="shopaccount" {if !empty($shopaccount)} disabled {/if} value="{php echo str_replace("手工输入:","",$bill['shopaccount']);}">
                        </div>
                    </div>
                    {else}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>商家帐户</label>
                        <div class="col-sm-8 col-xs-12">
                            <select class="form-control" name="shopaccount"  id="shopaccount">
                            {if !empty($result['bankid'])}
                                <option value="银行转帐|{$result['bankname']}|{$result['bankid']}|{$result['payee']}" {if $bill['shopaccount']=="银行转帐|" .$result['bankname'] . "|" .$result['bankid'] . "|" .$result['payee']}selected="selected" {/if}>银行转帐|{$result['bankname']}|{$result['bankid']}|{$result['payee']}</option>
                            {/if}
                            {if !empty($result['openid'])}
                                <option value="绑定微信|" {if $bill['shopaccount']=="绑定微信|" . $result['openid']}selected="selected" {/if}>绑定微信|{$result['openid']}</option>
                            {/if}
                            {if !empty($result['wechat1'])}
                                <option value="微信转帐|{$result['wechat1']}" {if $bill['shopaccount']=="绑定微信|" . $result['wechat1']}selected="selected" {/if}>绑定微信|{$result['wechat1']}</option>
                            {/if}
                            {if !empty($result['wechat2'])}
                                <option value="微信转帐|{$result['wechat2']}" {if $bill['shopaccount']=="绑定微信|" . $result['wechat2']}selected="selected" {/if} >绑定微信|{$result['wechat2']}</option>
                            {/if}
                             </select>
                        </div>
                    </div>
                    {/if}

                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>提现金额</label>
                        <div class="col-sm-8 col-xs-12">
                            <input type="text" class="form-control" placeholder="" name="withdraw" value="{$bill['withdraw']}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                        <div class="col-sm-8 col-xs-12">
                            {php echo view_ueditor('notes', $bill['notes']);}
                        </div>
                    </div>
                {/if}
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
</form>
</div>

{elseif $op == 'withdraw'} 
<div class="clearfix">
<form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" onsubmit="return checkwithdraw()">
    <div class="panel panel-default">
        <div class="panel-heading">提现</div>
        <div class="panel-body">
                {if $_G['isSuperAdmin'] && $_G['username']!=='caiwu' && $_G['username']!=='chuna' }
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>当前帐单</label>
                        <div class="col-sm-8 col-xs-12">
                            <textarea class="form-control" name="bill" rows="10">{$bill['bill']}</textarea>
                        </div>
                    </div>
                    {if empty($result['wechat1']) && empty($result['wechat2']) && empty($result['openid']) && empty($result['bankid'])}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>商家帐户</label>
                        <div class="col-sm-8 col-xs-12">
                            <input type="text" class="form-control" placeholder="" name="shopaccount" {if !empty($shopaccount)} disabled {/if} value="{$shopaccount}">
                        </div>
                    </div>
                    {else}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>商家帐户</label>
                        <div class="col-sm-8 col-xs-12">
                            <select class="form-control" name="shopaccount"  id="shopaccount">
                            {if !empty($result['bankid'])}
                                <option value="银行转帐|{$result['bankname']}|{$result['bankid']}|{$result['payee']}" >银行转帐|{$result['bankname']}|{$result['bankid']}|{$result['payee']}</option>
                            {/if}
                            {if !empty($result['openid'])}
                                <option value="绑定微信|{$result['openid']}" >绑定微信|{$result['openid']}</option>
                            {/if}
                            {if !empty($result['wechat1'])}
                                <option value="微信转帐|{$result['wechat1']}" >绑定微信|{$result['wechat1']}</option>
                            {/if}
                            {if !empty($result['wechat2'])}
                                <option value="微信转帐|{$result['wechat2']}" >绑定微信|{$result['wechat2']}</option>
                            {/if}
                             </select>
                        </div>
                    </div>
                    {/if}

                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>提现金额</label>
                        <div class="col-sm-8 col-xs-12">
                            <input type="text" class="form-control" placeholder="" name="withdraw" value="{$bill['withdraw']}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                        <div class="col-sm-8 col-xs-12">
                            {php echo view_ueditor('notes', $bill['notes']);}
                        </div>
                    </div>
                {/if}
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
</form>
</div>
{elseif $op == 'topup'}
<div class="clearfix">
<form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" onsubmit="return checktopup()">
    <div class="panel panel-default">
        <div class="panel-heading">充值</div>
        <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>充值金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="topup" value="{$bill['topup']}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>交易方式</label>
                    <div class="col-sm-8 col-xs-12">
                        <select class="form-control" name="payment"  id="payment">
                        <option value="0">请选择</option>
                        {loop $paymentlist $row}
                            <option value="{$row['name']}" {if $bill['payment'] == $row['name'] }selected="selected"{/if}>{$row['name']}</option>
                        {/loop}
                         </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易时间</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_form_field_date('paytime', date('Y-m-d H:i:s',$bill['paytime']),true);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易凭证</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_form_field_image('imgs',$config['imgs']);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_ueditor('notes', $bill['notes']);}
                    </div>
                </div>
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
</form>
</div>
{elseif $op == 'zhuanzhangcz'}
<div class="clearfix">
<form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" onsubmit="return checktopup()">
    <div class="panel panel-default">
        <div class="panel-heading">充值</div>
        <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">充值金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" disabled name="topup" value="{$bill['topup']}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">专属客服</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['personnel']}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易方式</label>
                    <div class="col-sm-8 col-xs-12">
                        <select class="form-control" name="payment" id="payment">
                        <option value="0">请选择</option>
                        {loop $paymentlist $row}
                            <option value="{$row['name']}" {if $bill['payment'] == $row['name'] }selected="selected"{/if}>{$row['name']}</option>
                        {/loop}
                         </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>公司帐户</label>
                    <div class="col-sm-8 col-xs-12">
                        <select class="form-control" name="yxaccount"  id="yxaccount">
                        <option value="0">请选择</option>
                        {loop $banklist $row}
                            <option value="{$row['bankname']}" {if $bill['yxaccount'] == $row['bankname'] }selected="selected"{/if}>{$row['bankname']}</option>
                        {/loop}
                         </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易时间</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_form_field_date('paytime', date('Y-m-d H:i:s',$bill['paytime']),true);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易凭证</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_form_field_image('imgs',$config['imgs']);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_ueditor('notes', $bill['notes']);}
                    </div>
                </div>
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-12" style="text-align: right;">
            {if $_G['isSuperAdmin']}
            
            {php echo html_entity_decode($bill['userrecord'], ENT_QUOTES);}
            {/if}
            {php  echo " 操作时间：" .date('Y-m-d H:i:s',$bill['addtime']);}
        </div>
    </div>
</form>
</div>
{elseif $op == 'shenhe'}
<div class="clearfix form-horizontal form">
    <div class="panel panel-default">
        <div class="panel-heading">支付详情</div>
        <div class="panel-body">

            <form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" >
                {if $bill['type']==0}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">当前帐单</label>
                    <div class="col-sm-8 col-xs-12">
                        <textarea class="form-control" disabled name="bill" rows="10">{$bill['bill']}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">商家帐户</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="shopaccount" value="{$bill['shopaccount']}">
                    </div>
                </div>
                {/if}
                {if $bill['type']==0}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">提现金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['withdraw']}">
                    </div>
                </div>
                {elseif $bill['type']==1}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">充值金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['topup']}">
                    </div>
                </div>
                {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">专属客服</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['personnel']}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_ueditor('notes', $bill['notes']);}
                    </div>
                </div>
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
                <input name="submit" type="submit" value="审核通过" class="btn btn-primary col-lg-1">
                <input type="hidden" name="__token__" value="{$Request.token}" />
            </form>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-12" style="text-align: right;">
            {if $_G['isSuperAdmin']}
            {php echo html_entity_decode($bill['userrecord'], ENT_QUOTES);}
            {/if}
            {php  echo " 操作时间：" .date('Y-m-d H:i:s',$bill['addtime']);}
        </div>
    </div>
</div>
{elseif $op == 'zhuanzhang'}
<div class="clearfix form-horizontal form">
    <form class="form-horizontal form" action="" method="post" encgiftgroup="multipart/form-data" >
    <div class="panel panel-default">
        <div class="panel-heading">支付详情</div>
        <div class="panel-body">
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">当前帐单</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea class="form-control" disabled name="bill" rows="10">{$bill['bill']}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">商家帐户</label>
                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control" disabled placeholder="" name="shopaccount" value="{$bill['shopaccount']}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">提现金额</label>
                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['withdraw']}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">专属客服</label>
                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['personnel']}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>交易方式</label>
                <div class="col-sm-8 col-xs-12">
                    <select class="form-control" name="payment"  id="payment">
                    <option value="0">请选择</option>
                    {loop $paymentlist $row}
                        <option value="{$row['name']}" {if $bill['payment'] == $row['name'] }selected="selected"{/if}>{$row['name']}</option>
                    {/loop}
                     </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>公司帐户</label>
                <div class="col-sm-8 col-xs-12">
                    <select class="form-control" name="yxaccount"  id="yxaccount">
                    <option value="0">请选择</option>
                    {loop $banklist $row}
                        <option value="{$row['bankname']}" {if $bill['yxaccount'] == $row['bankname'] }selected="selected"{/if}>{$row['bankname']}</option>
                    {/loop}
                     </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易时间</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_date('paytime', date('Y-m-d H:i:s'),true);}
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易凭证</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('imgs',$config['imgs']);}
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_ueditor('notes', $bill['notes']);}
                </div>
            </div>                        
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
    </form>
    <div class="form-group">
        <div class="col-sm-12" style="text-align: right;">
            {if $_G['isSuperAdmin']}
            
            {php echo html_entity_decode($bill['userrecord'], ENT_QUOTES);}
            {/if}
            {php  echo " 操作时间：" .date('Y-m-d H:i:s',$bill['addtime']);}
        </div>
    </div>
</div>
{elseif $op == 'view'}
<div class="clearfix form-horizontal form">
    <div class="panel panel-default">
        <div class="panel-heading">支付详情</div>
        <div class="panel-body">
                {if $bill['type']==0}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">当前帐单</label>
                    <div class="col-sm-8 col-xs-12">
                        <textarea class="form-control" disabled name="bill" rows="10">{$bill['bill']}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">商家帐户</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="shopaccount" value="{$bill['shopaccount']}">
                    </div>
                </div>
                {/if}
                {if $bill['type']==0}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">提现金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['withdraw']}">
                    </div>
                </div>
                {elseif $bill['type']==1}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">充值金额</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['topup']}">
                    </div>
                </div>
                {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易方式</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="payment" value="{$bill['payment']}">
                    </div>
                </div>
                {if $_G['isSuperAdmin']}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">公司帐户</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['yxaccount']}">
                    </div>
                </div>
                {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">专属客服</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{$bill['personnel']}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易时间</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" disabled placeholder="" name="withdraw" value="{php echo date('Y-m-d H:i:s',$bill['paytime']);}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">交易凭证</label>
                    <div class="col-sm-8 col-xs-12">
                        {if empty($bill['imgs'])}
                        <img src="{$bill['imgs']}" width="500px" />
                        {/if}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">备注</label>
                    <div class="col-sm-8 col-xs-12">
                        {php echo view_ueditor('notes', $bill['notes']);}
                    </div>
                </div>
                                           
        </div>      
    </div>
    <div class="form-group">
        <div class="col-sm-12" style="text-align: right;">
            {if $_G['isSuperAdmin']}
            
            {php echo html_entity_decode($bill['userrecord'], ENT_QUOTES);}
            {/if}
            {php  echo " 操作时间：" .date('Y-m-d H:i:s',$bill['addtime']);}
        </div>
    </div>
</div>
{elseif $op == 'display'}
<div class="main">
  <div class="panel panel-default">
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                    <tr>
                        <th >序号</th>
                        <th >软件</th>
                        <th >充值</th>
                        <th >提现</th>
                        <th >商家帐户</th>
                        {if $_G['isSuperAdmin']}
                        <th >公司帐户</th>
                        {/if}
                        <th >交易方式</th>
                        <th >专属客服</th>
                        <th >交易时间</th>
                        <th >操作时间</th>
                        <th >状态</th>
                        <th style="width:60px; text-align:right;">操作</th>
                    </tr>
                </thead>
                <tbody>
                {loop $list $index $item}
                {php $withdraw = $withdraw + $item['withdraw'];}
                {php $topup = $topup + $item['topup'];}
                  <tr> 
                    <td>{php echo $index+1;}</td>
                    <td>{$item['software']}</td>
                    <td><span class="label label-success">{php echo $item['topup']=="0.00"?'':number_format($item['topup'],2);}</span></td>
                    <td><span class="label label-info">{php echo $item['withdraw']=="0.00"?'':number_format($item['withdraw'],2);}</span></td>
                    <td>{$item['shopaccount']}</td>
                    {if $_G['isSuperAdmin']}
                    <td>{$item['yxaccount']}</td>
                    {/if}
                    <td>{$item['payment']}</td>
                    <td>{$item['personnel']}</td>
                    <td>{if !empty($item['paytime'])}{php echo date("Y-m-d H:i",$item['paytime']);}{/if}</td>
                    <td>{php echo date("Y-m-d H:i:s",$item['addtime']);}</td>
                    <td style="text-align:right;">
                        {if $item['status'] ==0}
                          {if ($_G['username']=='caiwu' || $_G['username']=='chuna') && $item['type']==1}
                          <a class="btn btn-info btn-sm" href="{php echo createWebUrl('bill', array('op' => 'zhuanzhangcz','themeid'=>$themeid, 'id' =>$item['id']));}" title=""><i class="icon-edit"></i>充值审核</a>
                          {elseif $_G['username']=='caiwu' && $item['type']==0}
                          <a class="btn btn-info btn-sm" href="{php echo createWebUrl('bill', array('op' => 'shenhe','themeid'=>$themeid, 'id' =>$item['id']));}" title=""><i class="icon-edit"></i>帐单审核</a>
                          {else}
                          待审核
                          {/if}
                        {elseif $item['status'] ==1}
                          {if $_G['username']=='chuna'}
                            <a class="btn btn-warning btn-sm" href="{php echo createWebUrl('bill', array('op' => 'zhuanzhang','themeid'=>$themeid, 'id' =>$item['id']));}" title=""><i class="icon-edit"></i>转帐</a>
                          {else}
                          待转帐
                          {/if}
                        {elseif $item['type'] ==1}
                        充值成功
                        {elseif $item['type'] ==0}
                        结算完成
                        {/if}
                    </td>
                    {if $item['type'] ==0 && $item['status'] ==0 && $_G['username']!=='caiwu' &&$_G['username']!=='chuna'}
                    <td style="text-align:right;">
                      <a class="btn btn-primary btn-sm" href="{php echo createWebUrl('bill', array('op' => 'edit','themeid'=>$themeid, 'id' =>$item['id']));}" title="修改帐单"><i class="icon-edit"></i>修改帐单</a>
                    </td>
                    {else}
                    <td style="text-align:right;">
                      <a class="btn btn-success btn-sm" href="{php echo createWebUrl('bill', array('op' => 'view','themeid'=>$themeid, 'id' =>$item['id']));}" title="查看详情"><i class="icon-edit"></i>查看详情</a>
                    </td>
                    {/if}
                </tr>
                {/loop}
                  <tr> 
                    <td>累计</td>
                    <td></td>
                    <td><span class="label label-success">{$topup}</span></td>
                    <td><span class="label label-info">{$withdraw}</span></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </tbody>
            </table>
        </div>
        {$pager}
    </div>
    </div>
{/if}
<script type="text/javascript">
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
    function checktopup(){
        if($.trim($(':text[name="topup"]').val()) == '') {
            alert('请输入充值金额');
            return false;
        }
        if($.trim($('#yxaccount option:selected').val()) == '0') {
            alert('请选择公司帐户');
            return false;
        }
        if($.trim($('#personnel option:selected').val()) == '0') {
            alert('请选择专属客服');
            return false;
        }

    }
    function checkwithdraw(){
        if($.trim($(':text[name="withdraw"]').val()) == '') {
            alert('请输入提现金额');
            return false;
        }

        if($.trim($('#yxaccount option:selected').val()) == '0') {
            alert('请选择公司帐户');
            return false;
        }
        if($.trim($('#personnel option:selected').val()) == '0') {
            alert('请选择专属客服');
            return false;
        }

    }
</script>
